<?php
	$cat_text = array();
	for($i = 1; $i <= 5; $i++)
	{
		$cur_cat_val = get_option('ibizmag_featured_' . $i);
		
		if(strlen($cur_cat_val) > 0 && $cur_cat_val != "0")
		{
			$cat_text[$i-1] = $cur_cat_val;
		}
	}
	query_posts(array('post__in' => $cat_text));     
	$count = 0; 
?>

<div id="featured_area" class="jcarousel-skin-tango">
  <h2>Nổi bật<!--Featured Entry--></h2>
  
  <?php if(count($cat_text) > 0) : ?>
  <ul>
  	<?php while (have_posts()) : the_post(); ?>
    <?php
		$ibizmag_post_excerpt = $post->post_content;
		$ibizmag_postimg_184px = get_post_meta($post->ID, "ibizmag_postimg_184px", true);
	?>
    <li>
      <div class="featured_item"> <img src="<?php echo $ibizmag_postimg_184px; ?>" height="135" width="200" alt="<?php the_title(); ?>" />
        <h3><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
        <div class="featured_meta"><?php the_time('d/m/Y') ?><!-- | Posted by <?php the_author_posts_link(); ?> <?php edit_post_link('edit'); ?>--></div>
        <?php custom_excerpt($ibizmag_post_excerpt, 270); ?>
      </div>
    </li>
    <?php $count++; ?>
    <?php endwhile; ?>
  </ul>
  <div class="jcarousel-control"> 
  	<a href="#" class="prev_button">Prev</a> 
    <?php
	for($i = 1; $i <= $count; $i++)
	{
	?>
    	<a href="#" class="numbering"><?php echo $i; ?></a> 
    <?php
	}
	?>
    <a href="#" class="next_button">Next</a> 
  </div>
  <?php else: ?>
  	Please select featured post via theme admin options.
  <?php endif; ?>
</div>